from Base import message, intersect, SS_VALID
from DRG import MDCT_DRG

def group(record):
  adrg_zd = ["F60.000","F60.100","F60.200","F60.201","F60.300","F60.301","F60.302","F60.400","F60.500","F60.600","F60.700","F60.800x001","F60.800x002","F60.800x003","F60.801","F60.802","F60.900","F61.x00","F61.x00x011","F62.000","F62.100","F62.800","F62.900","F63.000","F63.100","F63.200","F63.300","F63.800","F63.800x001","F63.801","F63.900","F68.800","F69.x00","F91.000","F91.100","F91.100x002","F91.200","F91.300","F91.900","F92.000","F92.900","R45.000","R45.100x001","R45.100x002","R45.200","R45.200x001","R45.200x003","R45.300x001","R45.300x002","R45.400x001","R45.400x002","R45.500","R45.600","R45.700x001","R45.700x002","R45.800x091","R46.200x002","R46.400","Z03.200"]
  adrg_zd1 = []
  adrg_ss = []
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and (not record.ssList or not intersect(record.ssList[0],SS_VALID)):
    message('符合TT2入组条件，匹配规则：主诊断匹配')

    if MDCT_DRG.TT29_group(record):
      return 'TT29'
        
    return 'TT2'
  else:
    return ''
    
